package org.opens.config;

import org.opens.entity.FactoryBeanEntity;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

@Component
public class FactoryBeanTest implements FactoryBean<FactoryBeanEntity> {

    /**
     * 说明：
     * <pre>
     *     1. 控制当前FactoryBeanTest在容器中是否是单例的；
     * </pre>
     */
    @Override
    public boolean isSingleton() {
        return false;
    }

    /**
     * 说明：
     * <pre>
     *     1. 控制当前FactoryBeanTest所生产的实例；
     * </pre>
     */
    @Override
    public FactoryBeanEntity getObject() throws Exception {
        return new FactoryBeanEntity();
    }

    /**
     * 说明：
     * <pre>
     *     1. 控制当前FactoryBeanTest所生产的实例的class类型；
     * </pre>
     */
    @Override
    public Class<?> getObjectType() {
        return FactoryBeanEntity.class;
    }

}
